package com.itheima.BufferedStream;




import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;

public class BufferedStrDemo {
    public static void main(String[] args) throws IOException {
        //创建字符缓冲输入流=普通字符输入流+缓冲区
        BufferedReader br1 = new BufferedReader(new FileReader("day623-24CharStream\\xx.txt"));


        //读取数据
        //先创建一个字符数组用来读取本地文件内容
        char[] chars = new char[1024];
        //接收每次读取的字符个数
        int len;

        //循环读
        while ((len=br1.read(chars))!=-1){
            System.out.println(new String(chars, 0, len));
        }
        //释放资源
        br1.close();
    }
}
